package com.xucy.springboot.designmodel.structural.composite.composite1;

/**
 * @Author xucy
 * @Date 2019-11-04 17:40
 * @Description
 **/

public class Test {
    public static void main(String[] args) {
        CourseComponent java=new Course("java","11");
        CourseComponent go=new Course("go","13");

        CourseComponent javaCatalog=new CourseCatalog("java目录");
        CourseComponent catalog=new CourseCatalog("目录");
        CourseComponent goCatalog=new CourseCatalog("go目录");

        javaCatalog.add(java);
        goCatalog.add(go);
        catalog.add(javaCatalog);
        catalog.add(goCatalog);
        catalog.print();
    }
}
